<?php

namespace App\Models;

use App\Scopes\IsDelScope;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\Request;
use Laravel\Sanctum\HasApiTokens;

class BaseModel extends Model
{
    protected $connection = '';
    protected static function booted()
    {
        static::addGlobalScope(new IsDelScope());
    }

    public function __construct(array $attributes = [])
    {
        $this->connection = Request::header('Environment', 'oms_prod');
        parent::__construct($attributes);
    }
}
